﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Dracham.Classes
{
    public class MobileObject : Object
    {
        public MobileObject() : base() { }

        public static MobileObject ResolveObject(String guid)
        {
            List<SpawnTimer> spawns = GameWorld.Spawns.Where(s => s.Object != null).ToList();
            SpawnTimer st = spawns.SingleOrDefault(s => s.Object.Id.ToString() == guid);
            if (st != null) return st.Object as MobileObject;

            List<Account> accounts = GameWorld.Accounts.Where(a => a.CurrentCharacter != null).ToList();
            Account acc = accounts.SingleOrDefault(a => a.CurrentCharacter.Id.ToString() == guid);
            if (acc != null) return acc.CurrentCharacter;

            return null;
        }
    }
}
